package models

import (
	"gorm.io/gorm"
)

type Shop struct {
	gorm.Model
	UserId int     `gorm:"type:int;comment:'用户id'"`
	Price  float64 `gorm:"type:decimal(10,2);comment:'商品价格'"`
	Num    int     `gorm:"type:int;comment:' 商品数量"`
	Status int     `gorm:"type:int;comment:'商品状态 0 未上架 1 已上架 2 下架'"`
}

func (o *Shop) GetShopById(db *gorm.DB, id int) error {
	err := db.Model(&Shop{}).Where("id = ?", id).Find(&o).Error
	return err
}
